package com.luo.fragments;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.luo.demo.R;
import com.luo.demo.ZygoteActivity2;

/**
 * Created by Administrator on 2017/5/8.
 */

public class Fragment1 extends Fragment {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View view = View.inflate(getActivity(), R.layout.fragment_ll,null);
        view.findViewById(R.id.jump).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ZygoteActivity2.startActivityForResult(getActivity(),Fragment1.this,1,Fragment2.class.getName());
            }
        });
        return view;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        System.out.println("requestCode = " + requestCode + "  resultCode = " + resultCode + "  data = " + (data==null));
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }
}
